<?php
require_once 'Connection.php';

/**
 * class WebServices
 *
 * ID, URL, Company
 *
 */
class WebServices {
	
	/**
	 * Get all WebServices
	 *
	 * @return array of fields
	 */
	public static function Select($filters = array()) {
		$con = Connection::GetConnection();
		$query = "SELECT ID, WSURL, Company FROM WebServices";
		
		if (array_key_exists('CongTy', $filters)) {
			$query .= " WHERE ";
			foreach ($filters['CongTy'] as $value) {
				$query .= "ID = $value OR ";
			}
			$query = preg_replace('/ OR $/', '', $query);
		}
				
		$lst = mysql_query($query, $con);
		$result = array();
		while ($item = mysql_fetch_assoc($lst))
			array_push($result, $item);
			
		return $result;
	}
	
}
?>